package me.zhengjie.modules.banner.service;

import me.zhengjie.base.PageInfo;
import me.zhengjie.base.CommonService;
import me.zhengjie.modules.banner.domain.Banner;
import me.zhengjie.modules.banner.service.dto.BannerDto;
import me.zhengjie.modules.banner.service.dto.BannerQueryParam;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
* @author TianI
* @date 2022-02-07
*/
public interface BannerService extends CommonService<Banner>  {

    static final String CACHE_KEY = "banner";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<BannerDto>
    */
    PageInfo<BannerDto> queryAll(BannerQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<BannerDto>
    */
    List<BannerDto> queryAll(BannerQueryParam query);

    Banner getById(Long id);
    BannerDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    int insert(BannerDto resources);
    int updateById(BannerDto resources);
    int removeById(Long id);
    int removeByIds(Set<Long> ids);

    Banner create(Long companyId, MultipartFile file);

    List<Banner> getBanner(Long companyId);


    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<BannerDto> all, HttpServletResponse response) throws IOException;
}
